// stores/counter.js
import { defineStore } from "pinia";
import { ref } from "vue";
export const useAppStore = defineStore("app", () => {
  // store

  const userName = ref(wx.getStorageSync("userName")||""); //客户名字
  const custPhone = ref(wx.getStorageSync("custPhone")||""); //客户手机
  const lastLoginTime = ref(wx.getStorageSync("lastLoginTime")||""); //登陆时间
  const orderId = ref(wx.getStorageSync("orderId")||""); //订单Id
  const orderNo = ref(wx.getStorageSync("orderNo")||""); //订单号
  const orderExecRcdId = ref(wx.getStorageSync("orderExecRcdId")||""); //订单执行记录Id
  const creditId = ref(wx.getStorageSync("creditId")||""); //授信信息Id
  const interviewContractId = ref(wx.getStorageSync("interviewContractId")||""); //面谈合同Id
  const borrowContractId = ref(wx.getStorageSync("borrowContractId")||""); //借款合同Id
  const bizId = ref(wx.getStorageSync("bizId")||""); //业务Id
  const playersType = ref(wx.getStorageSync("playersType")||""); //业务类型
  const playerRelationType = ref(wx.getStorageSync("playerRelationType")||""); //参与人关系
  const creditFileId = ref(wx.getStorageSync("creditFileId")||""); //征信授权书文件id
  const sensitiveFileId = ref(wx.getStorageSync("sensitiveFileId")||""); //隐私授权书文件id
  const creditContractId = ref(wx.getStorageSync("creditContractId")||""); //征信授权书合同id
  const sensitiveContractId = ref(wx.getStorageSync("sensitiveContractId")||""); //隐私授权书合同id
  const custodianOrg = ref(wx.getStorageSync("custodianOrg")||""); //办理机构id
  const custodianOrgName = ref(wx.getStorageSync("custodianOrgName")||""); //办理机构名字
  const cardNeFileId = ref(wx.getStorageSync("cardNeFileId")||""); //身份证id
  const cardPrFileId = ref(wx.getStorageSync("cardPrFileId")||""); //身份证id
  const cardNeFileName = ref(wx.getStorageSync("cardNeFileName")||""); //身份证文件名称
  const cardPrFileName = ref(wx.getStorageSync("cardPrFileName")||""); //身份证文件名称
  const orgId = ref(wx.getStorageSync("orgId")||""); //机构id
  const orgShortName = ref(wx.getStorageSync("orgShortName")||""); //机构名
  const applyType = ref(wx.getStorageSync("applyType")||""); //申请类型

  // action
  function setUserName(res) {
    userName.value = res;
  }
  function setCustPhone(res) {
    custPhone.value = res;
  }
  function setLastLoginTime(res) {
    lastLoginTime.value = res;
  }
  function setOrderId(res) {
    orderId.value = res;
  }
  function setOrderNo(res) {
    orderNo.value = res;
  }
  function setOrderExecRcdId(res) {
    orderExecRcdId.value = res;
  }
  function setCreditId(res) {
    creditId.value = res;
  }
  function setInterviewContractId(res) {
    interviewContractId.value = res;
  }
  function setBorrowContractId(res) {
    borrowContractId.value = res;
  }
  function setBizId(res) {
    bizId.value = res;
  }
  function setBizType(res) {
    playersType.value = res;
  }
  function setPlayersRelationType(res) {
    playerRelationType.value = res;
  }
  function setCreditFileId(res) {
    creditFileId.value = res;
  }
  function setSensitiveFileId(res) {
    sensitiveFileId.value = res;
  }
  function setCreditContractId(res) {
    creditContractId.value = res;
  }
  function setSensitiveContractId(res) {
    sensitiveContractId.value = res;
  }
  function setCustodianOrg(res) {
    custodianOrg.value = res;
  }
  function setCustodianOrgName(res) {
    custodianOrgName.value = res;
  }
  function setCardNeFileId(res) {
    cardNeFileId.value = res;
  }
  function setCardPrFileId(res) {
    cardPrFileId.value = res;
  }
  function setCardNeFileName(res) {
    cardNeFileName.value = res;
  }
  function setCardPrFileName(res) {
    cardPrFileName.value = res;
  }
  function setOrgId(res) {
    orgId.value = res;
  }
  function setOrgShortName(res) {
    orgShortName.value = res;
  }
  function setApplyType(res) {
    applyType.value = res;
  }

  return {
    userName,
    custPhone,
    lastLoginTime,
    orderId,
    orderNo,
    orderExecRcdId,
    creditId,
    interviewContractId,
    borrowContractId,
    bizId,
    playersType,
    playerRelationType,
    creditFileId,
    sensitiveFileId,
    creditContractId,
    sensitiveContractId,
    custodianOrg,
    custodianOrgName,
    cardNeFileId,
    cardPrFileId,
    cardNeFileName,
    cardPrFileName,
    orgId,
    orgShortName,
    applyType,
    setUserName,
    setCustPhone,
    setLastLoginTime,
    setOrderId,
    setOrderNo,
    setOrderExecRcdId,
    setCreditId,
    setInterviewContractId,
    setBorrowContractId,
    setBizId,
    setBizType,
    setPlayersRelationType,
    setCreditFileId,
    setSensitiveFileId,
    setCreditContractId,
    setSensitiveContractId,
    setCustodianOrg,
    setCustodianOrgName,
    setCardNeFileId,
    setCardPrFileId,
    setCardNeFileName,
    setCardPrFileName,
    setOrgId,
    setOrgShortName,
    setApplyType,
  };
});
